package com.qf.shopping.ustils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @Author 82024
 * @Date 2019/4/18 19:09
 * @Version 1.0
 * @Description 获取时间的帮助类
 **/
public class TimeUtil {

    private static SimpleDateFormat simpleDateFormat = null;

    static {
        simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
    }

    public static Long getTime(){
        String format = simpleDateFormat.format(new Date());
        return Long.valueOf(format);
    }

    public static Long getTime(Date date){
        String format = simpleDateFormat.format(date);
        return Long.valueOf(format);
    }
}
